package com.sc.nft.dao;


import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.CollectionLowestPrice;
import com.sc.nft.mapper.CollectionLowestPriceMapper;
import  com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;
import java.math.BigDecimal;

/**
 * (sc_collection_lowest_price)数据DAO
 *
 * @author zxy
 * @since 2023-10-25 14:59:25
 * @description 商户banner
 */
@Slf4j
@Repository
public class CollectionLowestPriceDao extends ServiceImpl<CollectionLowestPriceMapper, CollectionLowestPrice> {

    public boolean exists(Long collectionId, BigDecimal price){
       return lambdaQuery().eq(CollectionLowestPrice::getCollectionId,collectionId).ge(CollectionLowestPrice::getLowestPrice,price).count()>0;
    }
}